/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: lyl  Date: 2019-03-04 Time: 15:12
 *
 */
import {RequestAction, RequestMethod} from "../configuration/RequestConfiguration"
import {AppRequestPath} from "../configuration/AppConfig"
import {API_PROCEDURE2} from "../constant/API"
import global from "../configuration/global";

/**
 * 人员状态列表
 * @param action
 * @returns {*}
 */
export const PersonnelStatusScreenInit  = (action) => {
  return RequestAction(
    AppRequestPath() + API_PROCEDURE2,
    RequestMethod.Post,
    {
        "hotelId": global.hotelId,
        "fu": "ExecRetrieveJson",
        "jn": {
            "where": {
                "1": "1"
            },
            "fileds": {
                "fileds": ["userid","username","phone","phone_short","position","status","depart","depart_name","atwork","atqueue"]
            },
            "table": {
                "table": "viewQmsEngineer"
            },
            "wherestring": ["@@WS", ""]
         },
        "jnJson2": "{}",
    },
    action
  )
}

/**
 * 获取部门
 * @param action
 * @returns {*}
 */
export const PersonnelStatus_Filters_deps=(action)=>{
    return RequestAction(
        AppRequestPath() + API_PROCEDURE2,
        RequestMethod.Post,
        {
            "hotelId": global.hotelId,
            "fu": "ExecRetrieveJson",
            "jn": {
                "where": {
                    "1": "1"
                },
                "fileds": {
                    "fileds": ["code","name","pym","short","hotelid"]
                },
                "table": {
                    "table": "qms_department"
                },
                "wherestring": ["@@WS", ""]
            },
            "jnJson2": "{}",
        },
        action
    )
}